import { fetchPayListAPI } from '@/api/car/payApi'

const actions = {
  /* 发送请求获取缴费列表的action */
  async fetchPayList(context,pageParams) {
    const { data } = await fetchPayListAPI(pageParams)
    context.commit('updatePayList', data)
  }
}
const mutations = {
  /* 更新缴费列表的mutation */
  updatePayList(state, payListInfo) {
    state.payListInfo = payListInfo
  }
}
const state = () => {
  return {
    payListInfo: {}
  }
}

const getters = {
  payList: state => state.payListInfo.rows,
  total: state => state.payListInfo.total
}

export default {
  actions,
  mutations,
  state,
  getters,
  namespaced: true
}

